package com.example.lawyer.community;

import android.content.Context;
import android.net.Uri;
import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.lawyer.R;
import com.example.lawyer.databind.assembly.GeneralTopTitleData;
import com.example.lawyer.databind.assembly.MyMenuData;
import com.example.lawyer.databind.assembly.UserInfoCoverData;
import com.example.lawyer.databind.fargment.HomeBData;
import com.example.lawyer.databind.fargment.HomeDData;
import com.example.lawyer.databind.itemview.MenuViewData;
import com.example.lawyer.databinding.FragmentPageHomeDBinding;
import com.example.lawyer.interfacecallback.PageHomeDCallback;
import com.example.lawyer.interfaceservice.PageHomeCService;
import com.example.lawyer.interfaceservice.PageHomeDService;

import java.util.List;

public class PageHomeD extends Fragment implements PageHomeDCallback {
    FragmentPageHomeDBinding viewDataBinding = null;
    LayoutInflater layoutInflater;
    ViewGroup viewGroup;
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        layoutInflater = inflater;
        viewGroup = container;
        viewDataBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_page_home_d, container, false);

        return viewDataBinding.getRoot();
    }
    HomeDData homedData = new HomeDData();
    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        GeneralTopTitleData generalTopTitleData = new GeneralTopTitleData();
        generalTopTitleData.title.set("我的");
        homedData.generaldata.set(generalTopTitleData);
        viewDataBinding.setHomeddata(homedData);


        new PageHomeDService().InitMyMenuData(this);
        new PageHomeDService().InitUserInfoData(this);

    }


    //操作菜单
    @Override
    public void InitMenuData(MyMenuData data) {
        homedData.myMenuData.set(data);
    }

    //用户信息
    @Override
    public void InitUserInfo(UserInfoCoverData data) {
        System.out.println("执行了");
        homedData.userinfodata.set(data);
    }


}
